package com.barradata.common.utils

import android.widget.Toast

import com.barradata.Application

/**
 * Author:    WuNan
 * Email:     wunan@barradata.com
 * Created:   2019/7/7 9:36
 *
 **/
object ToastUtils {

    fun showShort(sequence: CharSequence) {
        showToast(sequence.toString(), Toast.LENGTH_SHORT)
    }

    fun showShort(strID: Int) {
        showToast(strID, Toast.LENGTH_SHORT)
    }

    fun showLong(sequence: CharSequence) {
        showToast(sequence.toString(), Toast.LENGTH_LONG)
    }

    fun showLong(strID: Int) {
        showToast(strID, Toast.LENGTH_LONG)
    }

    private fun showToast(toastStr: String, length: Int) {
        Toast.makeText(Application.getContext(), toastStr, length).show()
    }

    private fun showToast(id: Int, length: Int) {
        Toast.makeText(Application.getContext(), id, length).show()
    }

}
